{# This file is part of INGInious. See the LICENSE and the COPYRIGHTS files for #}
{# more information about the licensing of this file. #}

{% extends "layout_jinja.html" %}
{% block title %}{{ _("Register to course '{}'").format(course.get_name(user_manager.session_language())) }}{% endblock %}}
{% block navbar %}
    <nav aria-label="breadcrumb">
        <ol class="breadcrumb">
            <li class="breadcrumb-item"><a href="{{ get_homepath() }}/courselist" title={{ _("\"Course list\"") }} data-toggle="tooltip" data-placement="bottom"><i class="fa fa-th-list"></i></a></li>
            <li class="breadcrumb-item"><a href="{{ get_homepath() }}/course/{{ course.get_id() }}">{{ course.get_name(user_manager.session_language()) }}<span class="sr-only">{{_("(current)")}}</span></a></li>
            <li class="breadcrumb-item active"><a href="#">{{ _("Register") }}</a></li>
        </ol>
    </nav>
{% endblock %}
{% block content %}

    <div class="row justify-content-center">
        <div class="col-md-6">
            <h2>{{ _("Enroll in the course '{}'").format(course.get_name(user_manager.session_language())) }}</h2>
            <p>{{ _("This will enroll you in the course {}").format(course.get_name(user_manager.session_language())) }}</p>
            {% if error %}
                <div class="alert alert-danger" role="alert">
                    {{ _("Invalid password.") }}
                </div>
            {% endif %}
            <form method="post" action="">
                {% if course.is_password_needed_for_registration() %}
                    <div class="form-group">
                        <label for="register_password" class="control-label">{{ _("Password") }}</label>
                        <input class="form-control" type="text" id="register_password" name="register_password">
                    </div>
                {% endif %}
                <button type="submit" class="btn btn-primary">{{ _("Enroll in the course") }}</button>
            </form>
        </div>
    </div>

{% endblock %}